<?php include './include/conf.php'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">

<head>
		<title>Jardins familiaux de Lacroix-Falgarde : les parcelles</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
		<link rel="stylesheet" type="text/css" href="style/style.css" />
		<link rel="stylesheet" type="text/css" href="style/infosBulle.css" />
		<script type="text/javascript" src="./script/fonctions_communes.js"></script>
		<script type="text/javascript" src="./script/parcelles.js"></script>
		<script type="text/javascript" src="./script/infosBulle.js"></script>
		
</head>
	
<body>
	<div id="global">
		<!-- header -->
		<?php include './include/header.php' ; ?>
		
		<!-- fil d'ariane et espace adh�rant -->
		<p id="ariane">
			vous êtes ici : <a href="index.html">accueil</a> &gt; <a href="adherent.php">espace adhérent</a>  &gt; <a href="#">parcelles</a>
			<a id="espaceAdherent" href="connexion.php">espace adhérent</a>
		</p>	

		<!-- contenu -->
		<div id="contenu">
			<?php include('./include/menu_gauche.php'); ?>
			
			<div id="information">
			<h1>Parcelles</h1>
				<h2 class="parcelles">Plan des parcelles du jardin de Lacroix-Falgarde avec leur locataire :</h2>
				<img usemap="#mymap" src="./photos-site/plan-jardins.jpg" alt="Plan des parcelles du jardin de Lacroix-Falgarde"/>
				
				<map id="mymap" name="mymap"><?php
					$requete = $pdo->prepare("select * from parcelle where id_parcelle in(select id_parcelle from louer)");
					$requete->execute();
					while($val = $requete->fetch())
					{
						echo '<area shape="rect" coords="'.$val->coordonnees.'" id="'.$val->id_parcelle.'" alt="'.$val->id_parcelle.'"   />';
					}
				?></map>
				
				<br/>
				<h2 class="parcelles">Liste des adhérents sans parcelle :</h2>
				<br/>
				<?php 
				$requete = $pdo->prepare("select prenom,nom,email from adherent where id_adherent not in (select id_adherent from louer ) and est_archive = ?");
				$requete->execute(array(0));
				if($requete->rowcount() > 0)
				{
					?>
					<table id="tab_adherents">
					<thead>
						<tr>
							<th id="prenom_adh�rents">Prenom</th><th id="nom_adh�rents">Nom</th><th id="mail_adh�rents">Email</th>
						</tr>
					</thead>
					<tbody>
						<?php 
						while($user = $requete->fetch())
						{
							echo "<tr><td headers='prenom_adherent' id='prenom_adherent'>".$user->prenom."</td><td headers='nom_adherent' id='nom_adherent'>".$user->nom."</td><td headers='mail_adherent' id='mail_adherent'>".$user->email."</tr>";
						}
						?>
						
					</tbody>
					</table>
				<?php 
				}
				else 
				{
					echo "Aucun adhérent sans parcelle";
				}
				?>
			</div>

		</div>

		<!-- footer -->
		<?php include('./include/footer.php'); ?>
	</div>
</body>
</html>